package lab02.Test11;


/**
 * Created by Administrator on 2017/10/21.
 */
public class Square extends Rectangle{
double side;
Square(double side){
    super(side,side);
}
public String getTangle(){
    return "该正方形：\n"+"边长为："+this.length;
}
public String getDiag(){
    return "对角线长为："+Math.sqrt(2.0*this.length*this.length);
    }
    public void printMyWay(){
    super.printMyWay();
        System.out.println(this.getDiag());
    }
}

